//
//  HomeItemViewCell.m
//  parent
//
//  Created by yanzhen on 15/7/25.
//  Copyright (c) 2015年 ci123. All rights reserved.
//

#import "HomeItemViewCell.h"
#import "KxMenu.h"
@implementation HomeItemViewCell

- (void)awakeFromNib {
    // Initialization code
}

-(void)layoutSubviews
{
    CGSize size = CGSizeMake(86,16);
    NSString *nickname = _author.text;
    UIFont *font = [UIFont systemFontOfSize:15.0];
    CGSize labelsize = [nickname sizeWithFont:font constrainedToSize:size lineBreakMode:UILineBreakModeWordWrap];
    _nicknameWidth.constant = labelsize.width;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (IBAction)showMenu:(UIButton*)sender {
        NSArray *menuItems =
        @[
          
          [KxMenuItem menuItem:@"举报"
                         image:nil
                        target:nil
                        action:NULL],
          
          [KxMenuItem menuItem:@"复制"
                         image:nil
                        target:self
                        action:@selector(pushMenuItem:)],
          ];
        
        KxMenuItem *first = menuItems[0];
        first.foreColor = [UIColor colorWithRed:47/255.0f green:112/255.0f blue:225/255.0f alpha:1.0];
        first.alignment = NSTextAlignmentCenter;
        
        [KxMenu showMenuInView:self
                      fromRect:sender.frame
                     menuItems:menuItems];

}

@end
